home *** CD-ROM | disk | FTP | other *** search
- public class ExternalPictureComp extends ComponentApp {
- DDrawPicture cdp;
- String theSource;
- String codebase;
- DAssetManager assetMan;
-
- public String PropertyListener(String var1, String var2, int var3, int var4, IDInspector var5) {
- if (var3 == 1) {
- if (var1.compareTo("Image URL") == 0) {
- return this.theSource;
- }
- } else {
- if (var1.compareTo("Image URL") == 0) {
- this.theSource = var2;
- if (this.theSource.indexOf(":") <= 0) {
- this.theSource = "http://" + this.theSource;
- }
- }
-
- this.cdp.setHTMLBefore("<img src=\"" + this.theSource + "\"><!--");
- this.cdp.setHTMLAfter("-->");
- }
-
- return "";
- }
-
- public void onCopy() {
- }
-
- public String onInstall(DAssetManager var1, String var2) {
- this.assetMan = var1;
- this.codebase = var2;
- return "Picture Loader";
- }
-
- protected void finalize() {
- }
-
- public void onUnInstall(DAssetManager var1) {
- }
-
- public void onPublish(DAssetManager var1, int var2) {
- }
-
- public void onDrop(IDLayout var1, IDRect var2, int var3) {
- if (var3 == 1) {
- this.theSource = "";
- this.cdp = new DDrawPicture();
- this.cdp.SetPositionRect(var2.getLeft(), var2.getTop(), var2.getRight(), var2.getBottom());
- this.cdp.setStretch(2);
- this.cdp.setImageFile(this.codebase + "ExternalPictureComp.gif");
- var1.AddObject(this.cdp);
- }
- }
-
- public void onInspect(CStringArray var1, CStringArray var2) {
- var1.Set("Image URL");
- var2.Set("String\u0000");
- }
- }
-